/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved.
 * Description: 适配GE新接口头文件提取
 * Author: lilianlin
 * Create: 2020-05-14
 */

#ifndef OP_HVD_COMM_H
#define OP_HVD_COMM_H

#include "hccl_types.h"

namespace hccl {
const string HVD_OPS_LIB_NAME = "hvd_ops_kernel_info";
const string HVD_KERNEL_OP_TYPE_BROADCAST = "HorovodBroadcast";
const string HVD_KERNEL_OP_TYPE_ALLREDUCE = "HorovodAllreduce";
const string HVD_KERNEL_OP_TYPE_ALLGATHER = "HorovodAllgather";
const string HVD_KERNEL_OP_TYPE_WAIT = "HorovodWait";
const string HVD_ATTR_RANK_SIZE = "rank_size";
const string HVD_ATTR_SHAPE = "shape";
const string HVD_ATTR_DTYPE = "dtype";
const std::string ATTR_INTER_EVENT_IDENTIFY = "event_id";
const std::string ATTR_NAME_STREAM_LABEL = "_stream_label";

struct TensorInfo {
    void *inputDataAddr;
    void *outputDataAddr;
    int32_t count;
    int32_t dataType;
    std::string name;
    std::vector<int64_t> dims;
};
struct HvdCallBackInfo {
    int32_t opType;
    size_t vectorSize;
    int32_t deviceID;
    rtEvent_t event;
    int64_t rootId;
    rtStream_t stream;
    std::string hcclType;
    std::vector<TensorInfo> kernelHvdInfo;
};
using HvdKernelInfoPrivateDef = struct HvdPrivateDef {
    u32 eventID;
    HcclDataType dataType;
};
const std::vector<std::string>  HVD_SUPPORTED_OP_TYPE = {
    HVD_KERNEL_OP_TYPE_BROADCAST,
    HVD_KERNEL_OP_TYPE_ALLREDUCE,
    HVD_KERNEL_OP_TYPE_ALLGATHER,
    HVD_KERNEL_OP_TYPE_WAIT
};
}
#endif
